namespace KinonekoSoftware.Studio
{
    /// <summary>
    /// 实现高效的枚举类型反射枚举。
    /// </summary>
    /// <typeparam name="T">指定的枚举类型。</typeparam>
    public sealed class LazyEnumValues<T> where T : struct, Enum
    {
        private static readonly Lazy<IEnumerable<T>> _factory = new Lazy<IEnumerable<T>>(ClassStatic.GetEnums<T>);

        public static IEnumerable<T> Values => _factory.Value;
    }
}